package game.util
{
	import com.utils.ZooJscript;

	public class CarJsCall
	{
		public function CarJsCall()
		{
		}
		
		public static function toOldVersion():void
		{
			ZooJscript.callJsFunction("toOldVersion");
		}
		
		public static function showOrHideHistory(value:Boolean):void
		{
			ZooJscript.callJsFunction("setDisplayLine",value);
		}
		
		public static function changeHistorySkin(skin:String):void
		{
			skin="yellow";
			ZooJscript.callJsFunction("setSkin",skin);
		}
		
		public static function openRankView(skin:String):void
		{
			skin="yellow";
			ZooJscript.callJsFunction("triggerRank",skin);
		}
		
		public static function openSignView(skin:String):void
		{
			skin="yellow";
			ZooJscript.callJsFunction("triggerSign",skin);
		}
		
		public static function autoOpenSignView(skin:String):void
		{
			skin="yellow";
			ZooJscript.callJsFunction("autoTriggerSign",skin);
		}
		/**初始曲线**/
		public static function initHistoryView(data:String):void
		{
			//trace("initHistoryView",data);
			ZooJscript.callJsFunction("initDataPrepare",data);
		}
		/**曲线**/
		public static function updateHistoryResult(gameid:Number,gamecount:int,carindex:String):void
		{
			//trace("updateHistoryResult:",gameid,gamecount,carindex,ZooMain.time.nowTimeTextNoDay);
			ZooJscript.callJsFunction("pushChooseTypeData",gameid,gamecount,carindex);
		}
		/**曲线一局结果**/
		public static function updateHistoryMoney(gameid:Number,gamecount:int,money:Number):void
		{
			//trace("updateHistoryMoney:",gameid,gamecount,money,ZooMain.time.nowTimeTextNoDay);
			ZooJscript.callJsFunction("pushWinLostAmountData",gameid,gamecount,money);
		}
		
		public static function updatePageUserData(uname:String,money:Number,score:Number,vip:int):void
		{
			ZooJscript.callJsFunction("setLeftValue",uname,money,score,vip);
		}
		
		public static function updateClientMoney():void  
		{
			ZooJscript.callJsFunction("updClientMoney");
		}
		public static function getNewRankUI():void
		{
			ZooJscript.callJsFunction("rankFun_getNewRankUI");
			//ZooJscript.callJsFunction("rankFun.getNewRankUI");
		}
		public static function analysisJsCall(type:int):void
		{
			ZooJscript.callJsFunction("accedata",{"type":type});
		}
		
		public static function goRecharge():void
		{
			ZooJscript.callJsFunction("recharge");
		}
		/**关闭嫦娥活动**/
		public static function closeChangEView(b:Boolean):void
		{
			ZooJscript.callJsFunction("closeChangEView",b);
		}
		/**嫦娥活动蛋点击**/
		public static function eggClickOpenChangE():void{
			ZooJscript.callJsFunction("eggClickOpenChangE");
		}
		
		
		/**关闭转盘活动**/
		public static function closeTurntablView(b:Boolean):void
		{
			ZooJscript.callJsFunction("closeTurntablView",b);
		}
		/**转盘问号点击**/
		public static function whyClickOpenTurntabl():void{
			ZooJscript.callJsFunction("whyClickOpenTurntabl");
		}
		
		public static function getDomainName():String
		{
			try
			{
				var hostname:String = ZooJscript.callJsFunction("eval","window.location.hostname");
				if (hostname&&hostname!="null"&&hostname.length)
				{
					var list:Array = hostname.split(".");
					if (list.length>1) return list[list.length-2];
				}
			} 
			catch(error:Error) {}
			return "";
		}
		
		/**奖池活动**/
		public static function SwfMessNotice(data:Object):void{
			ZooJscript.callJsFunction("SwfMessNotice",data);
		}
		
	}
}